<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../libs/vue.js"></script>
    <style>
        .father {
            width: 300px;
            height: 300px;
            background-color: purple;
        }
        .son {
            width: 100px;
            height: 100px;
            background-color: deeppink;
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- self修饰符，限制事件只能被自己触发 -->
        <div class="father" @click.self="getFather">
            父亲
            <div class="son" @click="getSon">儿子</div>
        </div>
    </div>
    <script>
        let vm = new Vue({
            el:'#app',
            data:{

            },
            methods: {
                getFather(){
                    console.log('父标签被点击！')
                },
                getSon(){
                    console.log('子标签被点击！')
                }
            },
        })
    </script>
</body>
</html>